Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store and confirm what experiments a user is enrolled in #208

Merged
merged 9 commits into from
Aug 2, 2022

Conversation

charliescheer
Copy link
Contributor

On Day One iOS right now we are looking to be able to have experiments that are only for new users. We had been verifying this by using a locally stored and calculated array of the experiments that a user is enrolled in or qualified for. This has a few issues with it, namely the potential for getting out of sync with what experiments ExPlat thinks a user is enrolled in, and has caused a bug where new user only experiments are being shown to existing users.

This PR is part of the process to fix that bug. With these changes, when we refresh the experiments I am storing the experiments names that are returned from the server and making that accessible outside of the package to confirm if a user is enrolled for a specific experiment. We need to store this separately because the server returns the name of the experiment for all enrolled experiments as a key and what the user is assigned to as a value. If the user is in the control group it returns null, and the existing ab-testing-assignments dictionary ignores the pairs with null as a value.

I chose to store the values in a separate array rather than change ab-testing-assignments to store the keys even if nothing was returned to avoid creating any potential issues with other apps that are using the experiments values.

With these changes we will be able to more accurately confirm what experiments a user participating in

@charliescheer charliescheer self-assigned this Jul 27, 2022
Sources/Experiments/ExPlat.swift Outdated Show resolved Hide resolved
Sources/Experiments/ExPlat.swift Outdated Show resolved Hide resolved
Sources/Experiments/ExPlat.swift Outdated Show resolved Hide resolved
Copy link
Contributor

@jleandroperez jleandroperez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@charliescheer changes look good! please feel free to :shipit: once the Hound warnings are gone sir!

@charliescheer charliescheer merged commit 6c30009 into trunk Aug 2, 2022
@charliescheer charliescheer deleted the charlie/dayone-experiments-verification branch August 2, 2022 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants